<template>
	<view class="application-cell-view" @click="clickApplicationCellView(title)">
		<view class="application-cell-top-view">
			<u-image :src="src" height="100%" width="100%" mode="aspectFit"></u-image>
		</view>
		<view class="application-cell-bottom-view">
			{{title}}
		</view>

		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src: this.title == '资产盘点' ? '/static/img/property/inventory.png' : (this.title == '资产授权' ?
					'/static/img/property/authorization.png' : '/static/img/property/approval.png')
			}
		},
		props: {
			title: {
				type: String,
				default: ''
			}
		},
		methods: {
			clickApplicationCellView(e) {
				if (e == '资产盘点') {
					this.$refs.uToast.show({
						title: '敬请期待...',
						type: 'primary'
					})
				} else if (e == '资产授权') {
					this.$refs.uToast.show({
						title: '敬请期待...',
						type: 'primary'
					})
				} else if (e == '单据审批') {
					this.$refs.uToast.show({
						title: '敬请期待...',
						type: 'primary'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.application-cell-view {
		width: 150rpx;
		height: 150rpx;
		display: flex;
		flex-direction: column;

		.application-cell-top-view {
			height: 66%;
		}

		.application-cell-bottom-view {
			flex-grow: 1;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 25rpx;
		}
	}
</style>
